<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
		<style>
			
		</style>
		<script src='./src/vue.js'></script>
	</head>

	<body>
		<div id="app">
			<button @click="removeFirst">删除第一个</button>
			<button @click="reverse">反转数组</button>
			<ul>
				<li  @click="handle" v-for="item,index in list" :key='item.id'>
					{{item.title}}
				</li>
			</ul>
		</div>
		
		<script>


			let vm = new Vue({
				data:{
					list: [{id:123,title:'miaowei'},{id:456,title:'11111'}]
				},
				methods: {
					handle(ev){
						ev.target.style.background = 'red';
					},
					removeFirst () {
						this.list.splice(0,1)
					},
					reverse(){
						this.list.reverse();
					}
				}
			})

			vm.$mount('#app');
		</script>
	</body>
</html>